package com.glsc.ngateway.common.api.shortmsg.bo;

import java.util.HashMap;
import java.util.Map;

public class ShortMsgResponse {

    public static final String Success = "0";
    public static final String Fail = "-1";

    public static final String data_key_ShortMessageId = "ShortMessageId";
    public static final String data_key_SendStatus = "SendStatus";

    String errCode;
    String errMsg;
    Map<String, Object> data = new HashMap<String, Object>();


    public static ShortMsgResponse instanceOfSuccess(String shortmsgId) {
        ShortMsgResponse response = new ShortMsgResponse();
        response.setErrCode(Success);
        response.setErrMsg("Success");
        response.getData().put(data_key_ShortMessageId, shortmsgId);
        return response;
    }

//    public static ShortMsgResponse instanceOfSuccess(NoticeMessageSend noticeMessageSend) {
//        ShortMsgResponse response = new ShortMsgResponse();
//        response.setErrCode(ShortMsgResponse.Success);
//        response.setErrMsg("Success");
//
//        for (SendStatus ss : SendStatus.values()) {
//            if (ss.getCode().equals(noticeMessageSend.getSendStatus())) {
//                response.getData().put(data_key_SendStatus, ss.toString());
//                break;
//            }
//        }
//
//        return response;
//    }

    public static ShortMsgResponse instanceOfFail(String errMsg) {
        ShortMsgResponse response = new ShortMsgResponse();
        response.setErrCode(Fail);
        response.setErrMsg(errMsg);
        return response;
    }


    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }


    @Override
    public String toString() {
        return "ShortMsgResponse{" +
                "errCode='" + errCode + '\'' +
                ", errMsg='" + errMsg + '\'' +
                ", data=" + data +
                '}';
    }
}
